package com.photoeditor.demo.ui.widget.image.brush;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;


/**
 * Created by winn on 17/8/15.
 */

public class MopiBrushView extends BrushView {

    public static final int EFFECT_PERCENTAGE = 70;

    private Bitmap mHighQualityEffectBitmap;

    public MopiBrushView(Context context) {
        super(context);
    }

    public MopiBrushView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        setPaintStyle(PAINT_STYLE_SOFT);
    }

    public void setEffectBitmap(Bitmap bitmap) {
        if (bitmap == null) {
            return;
        }
        mHighQualityEffectBitmap = bitmap;
        bitmap = Bitmap.createScaledBitmap(bitmap, bitmap.getWidth() / 2, bitmap.getHeight() / 2, true);
        notifyLoadEffectBitmapSuccess(bitmap);
    }

    @Override
    protected void loadEffectBitmap() {

    }

    @Override
    protected Bitmap loadEffectBitmap(Bitmap bitmap) {
        return mHighQualityEffectBitmap;
    }

    public void reset() {
        super.reset();
        mHighQualityEffectBitmap = null;
    }

}
